//@ sourceURL=WasteManageView.js
Ext.ns("WasteManageView");
WasteManageView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        WasteManageView.superclass.constructor.call(this, {
            id : "WasteManageView",
            title : "废物管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
        var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'WasteManageForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "废物名称"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_wasteName_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "事故管理列表",
                rowActions:true,
                listUrl : __ctxPath + "/environmental/listWasteManage.do",
                removeUrl : __ctxPath + "/environmental/deleteWasteManage.do",
                fields : [ "id", 'years', 'wasteNo','wasteName', "wasteNumber", "storageDate","wasteWorkshop","wasteSource","containerType","containerNumber","wasteStorage","outWarehouseDate","outWarehouseNum","wasteGoDirection"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    hidden : true,
                    sortable : true
                },{
                    header : "废物编号",
                    dataIndex : "wasteNo",
                    width : 50
                },{
                    header : "废物名称",
                    dataIndex : "wasteName",
                    width :80
                },{
                    header : "废物数量（入库）",
                    dataIndex : "wasteNumber",
                    width : 70
                },{
                    header : "入库时间",
                    dataIndex : "storageDate",
                    width : 70
                },{
                    header : "产废车间",
                    dataIndex : "wasteWorkshop",
                    width : 70
                }, 
                {
                    header : "废物来源",
                    dataIndex : "wasteSource",
                    width : 80
                },/*{
                    header : "容器类别",
                    dataIndex : "containerType",
                    width : 70
                },{
                     header : "废物存放位置",
                     dataIndex : "wasteStorage",
                     width : 80
                },*/{
                    header : "出库日期",
                    dataIndex : "outWarehouseDate",
                    width : 70
               },{
                   header : "出库数量",
                   dataIndex : "outWarehouseNum",
                   width : 70
              }/*,{
                  header : "废物去向",
                  dataIndex : "wasteGoDirection",
                  width : 80
             },*/
                    /*header : "管理",
                    dataIndex : "id",
                    sortable : false,
                    width : 80,
                    renderer : function(j, i, g, m, h) {
                        //var l = g.data.id;
                        var l =j;
                        var k = "";
                        if (l) {
                            if (isGranted("_ConMaterialDel")) {
                                k += '<button title="删除" value=" " class="btn-delete" onclick="ConMaterialsBaseInfoView.remove('
                                        + l + ')"></button>';
                            }
                                                           
                        }
                        return k;
                    }
                } ,*/
            ]
            },
            tree : {
                treeUrl : __ctxPath + "/environmental/treeLoadWasteManage.do"
            }
            
        });
        return yearGridComponents;
    }
});

